
package com.rt.schedulenew.utils.global;
public enum HttpCode
{
    OK(Integer.valueOf(200), "请求成功 "), 
    MULTI_STATUS(Integer.valueOf(207), "频繁操作"), 
    LOGIN_FAIL(Integer.valueOf(303), "登录失败 "), 
    BAD_REQUEST(Integer.valueOf(400), "参数不合法"), 
    UNAUTHORIZED(Integer.valueOf(401), "没有登录"), 
    FORBIDDEN(Integer.valueOf(403), "没有权限 "), 
    NOT_FOUND(Integer.valueOf(404), "找不到页面"), 
    REQUEST_TIMEOUT(Integer.valueOf(408), "请求超时"), 
    CONFLICT(Integer.valueOf(409), "发生冲突"), 
    GONE(Integer.valueOf(410), "已被删除"), 
    LOCKED(Integer.valueOf(423), "已被锁定"), 
    INTERNAL_SERVER_ERROR(Integer.valueOf(500), "服务器内部出错 ");
    
    public Integer key;
    public String value;
    
    private HttpCode(final Integer key, final String value) {
        this.key = key;
        this.value = value;
    }
    
    public static HttpCode get(final Integer key) {
        final HttpCode[] values;
        final HttpCode[] dataArray = values = values();
        for (final HttpCode obj : values) {
            if (obj.key.equals(key)) {
                return obj;
            }
        }
        return null;
    }
}
